//
//  YDAAboutUsController.m
//  siyanone
//
//  Created by LK-IOS on 2018/3/26.
//  Copyright © 2018年 LK-News. All rights reserved.
//

#import "YDAAboutUsController.h"
#import "YDAFeedbackController.h"
#import "YDARegistrationController.h"
#import "YDAAboutUsCell.h"


@interface YDAAboutUsController ()<UITableViewDelegate , UITableViewDataSource>

//tableView
@property (nonatomic , weak) UITableView *tableView;

@end

@implementation YDAAboutUsController


- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = NumberColor(247, 247, 247);
    self.title = @"关于我们";
    
    [self tableView];
    
}

/*******tableView********/
-(UITableView *)tableView
{
    if (_tableView == nil) {
        
        UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, LKScreenW, self.view.height - self.tabBarController.tabBar.height) style:UITableViewStylePlain];
        [self.view addSubview:tableView];
        tableView.backgroundColor = NumberColor(247, 247, 247);
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        tableView.dataSource = self;
        tableView.delegate = self;
        tableView.estimatedRowHeight = 0;
        tableView.estimatedSectionFooterHeight = 0;
        tableView.estimatedSectionHeaderHeight = 0;
        tableView.scrollEnabled = NO;
        if (isIos11) {
            tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        }
        _tableView = tableView;
    }
    return _tableView;
}

#pragma UITableViewDelegate , UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return isPhoneX ? rateX812(50) : rate750(50);;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YDAAboutUsCell *cell = [YDAAboutUsCell cellWithTableview:tableView];
    if (indexPath.row == 0) {
        cell.cateLabelString = @"意见反馈";
    }else{
        cell.cateLabelString = @"用户服务协议";
    }
    return cell;
}
//
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        YDAFeedbackController *vc = [[YDAFeedbackController alloc] init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else{
        
        YDARegistrationController *vc = [[YDARegistrationController alloc] init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }
}



@end
